Repository navigation
Add k-infinity estimator for IndependentOperator - #4053
EdenRochmanSharabi wants to merge 7 commits into
Conversation
Add calculate_kinf parameter to IndependentOperator that estimates the infinite multiplication factor from one-group reaction rates, following OpenMC's keff convention for (n,xn) reactions. Add nu-fission one-group cross section support to MicroXS.
|
Looks like a nice PR.
|
- Auto-detect kinf computation when keff is not provided and all MicroXS contain fission + nu-fission, removing the calculate_kinf parameter from IndependentOperator and from_nuclides - Add neutrons_out field to ReactionInfo in chain.py, replacing the _XN_REACTION regex and _neutrons_emitted() function with a lookup into the REACTIONS dict for neutron exit-channel counts - Move nu-fission cross section collapsing from Python to C++ via Nuclide::collapse_nu_fission_rate, with ctypes binding and C API
|
Thanks for the thorough review @GuySten! I've addressed all three suggestions:
All existing kinf tests updated and passing. |
paulromano
left a comment
There was a problem hiding this comment.
I'd like to take a look at this one before merging
|
Thanks for the rework. The I've pushed a commit with the mechanical cleanups (strict 1. What quantity is this?The docstring says "the infinite multiplication factor," which is a statement For a single homogenized material, or a model where everything is marked I'd like the docstring to state the estimator explicitly, with the index ranges,
Worth stating plainly in the docstring that this is k∞ and not k-eff. The two 2. A narrowed
|
- Fix volume normalization in _estimate_k_inf: divide rate by volume_b_cm so multi-material estimates are not biased by material volume - Add precondition after super().__init__() checking that MicroXS covers all chain reactions, disabling kinf estimate with a warning when absorption channels are missing (prevents silent nu-bar result) - Refactor collapse_nu_fission_rate to collapse the pre-tabulated XS_NU_FISSION column on the nuclide union grid instead of duplicating the integration loop with per-segment nu() calls - Rewrite _estimate_k_inf docstring with full formula, index ranges, k-inf vs k-eff distinction, (n,xn) derivation, and assumptions list - Add tests: two-material volume independence and disabled kinf when reactions are missing
|
Thanks for the detailed review. Addressed everything in 3006080: 1. Docstring. Rewrote 2. Precondition. After 3. Background absorption. Not implemented in this PR. Documented as a limitation in the docstring (background absorption is assumed constant and ignored). 4. (n,xn) derivation. Added to the docstring: k_eff = P/(A+L-X), reduced absorption A-X matching OpenMC's estimators, done in one pass via the (1-x_j) factor. 5. Volume normalization. Fixed: rate is now divided by 6. C++ refactor. |
GuySten
left a comment
There was a problem hiding this comment.
LGTM. we will wait for pauls review.
Summary
calculate_kinf=Trueparameter toIndependentOperatorandfrom_nuclides(mutually exclusive withkeff)MicroXS, with a new_collapse_nu_fission()helper that integrates nu(E)*sigma_f(E) from pointwise ENDF data against the user-provided multigroup fluxResults.get_keff()Changes
openmc/deplete/independent_operator.py:_neutrons_emitted()parser,_estimate_k_inf()method (MPI-aware),calculate_kinfparameter with validationopenmc/deplete/microxs.py:'nu-fission'in_valid_rxns,_collapse_nu_fission()for pointwise collapse,from_multigroup_flux()routing for nu-fissiondocs/source/usersguide/depletion.rst: user guide section oncalculate_kinftests/unit_tests/test_deplete_independent_operator.py: analytic k_inf (with (n,2n)), multigroup flux, decay step,_neutrons_emittedtable, error pathstests/unit_tests/test_deplete_microxs.py: nu-bar validation against ENDF data (U235 thermal ~2.43)Test plan
_neutrons_emittedhandles all reaction name patterns correctlyCloses #2132